package com.king.base;

import com.google.common.base.Objects;

/**
 * Created by Administrator on 2015/4/21.
 */
public class ObjectsHelper {
    public static void main(String[] args) {
        Student jim = new Student();
        jim.setId(1);
        jim.setName("xiaoming");
        jim.setAge(13);
        System.out.println(jim.toString());
    }

    public static class Student {
        private int id;
        private String name;
        private int age;

        public int getId() {
            return id;
        }

        public void setId(Integer id) {
            this.id = id;
        }


        public void setName(String name) {
            this.name = name;

        }

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }
        public String getName() {
            return name;
        }
        public String toString() {
            return Objects.toStringHelper(this.getClass())
                    .add("id", id).add("name", name).add("age", age).omitNullValues().toString();


        }
    }
}